<template>
  <div id="FarmersRenovation">
    <div class="top">
      <img v-if="ISshowNowKNLX" style="width: 80%; margin: 0 auto"
        src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/YPC/12.png" />
      <img v-if="!ISshowNowKNLX" style="width: 80%; margin: 0 auto"
        src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/ZLJ/fgx2.png" />
      <p>
        <span :style="{
          width: ISshowNowKNLX ? '31%' : '49%',
          display: 'inline-block',
          textAlign: 'left',
          paddingLeft: '2%',
        }">危改申请</span>
        <span :style="{
          width: ISshowNowKNLX ? '31%' : '48%',
          display: 'inline-block',
          textAlign: 'center',
          paddingLeft: ISshowNowKNLX ? '0%' : '20%',
        }">农户危改整治</span>
        <span v-show="ISshowNowKNLX" style="width: 31%; display: inline-block; text-align: center">困难家庭补助申请</span>
      </p>
    </div>
    <div class="content" v-if="this.row.JDDJ == '243' || this.row.JDDJ == '244'">
      <div class="info" v-if="isshow6">{{ html }}</div>
      <van-form validate-first :class="{ smallFontSize: showEdition, mediumFontSize: !showEdition }">
        <p class="subTitle"><span class="line"></span>鉴定信息</p>
        <div class="inputWrap">
          <!--<span style="color: #ff0000">*</span>-->
          <van-field readonly v-model="formData1.JDJG" label="鉴定机构" />
          <!--<van-field-->
          <!--readonly-->
          <!--clickable-->
          <!--name="picker"-->
          <!--:value="formData.JDJG"-->
          <!--label="鉴定机构"-->
          <!--placeholder="选择鉴定机构"-->
          <!--@click="showPickerT = true"-->
          <!--/>-->
          <!--<van-popup v-model="showPickerT" position="bottom">-->
          <!--<van-picker-->
          <!--show-toolbar-->
          <!--:columns="TownColumns"-->
          <!--value-key="DICNAME"-->
          <!--@confirm="onConfirmTown"-->
          <!--@cancel="showPickerT = false"-->
          <!--/>-->
          <!--</van-popup>-->
        </div>
        <div class="inputWrap">
          <!--<span style="color: #ff0000">*</span>-->
          <van-field readonly v-model="formData1.JDBGBH" label="鉴定报告编号" />
        </div>
        <div class="inputWrap">
          <!--<span style="color: #ff0000">*</span>-->
          <!--<van-field readonly v-model="formData.JDDJ | inUseName1(ENUM.JDDJARR)" label="鉴定等级" />-->
          <van-field readonly clickable name="picker" :value="formData1.JDDJ | inUseName1(ENUM.JDDJARR)" label="鉴定等级"
            placeholder="请选择鉴定等级" @click="ENUM.JDDJ = true" />
          <!--<van-popup v-model="ENUM.JDDJ" position="bottom">-->
          <!--<van-picker-->
          <!--show-toolbar-->
          <!--:columns="ENUM.JDDJARR"-->
          <!--value-key="DICNAME"-->
          <!--@confirm="onConfirmTown1"-->
          <!--@cancel="ENUM.JDDJ = false"-->
          <!--/>-->
          <!--</van-popup>-->
        </div>
        <div class="inputWrap">
          <!--<span style="color: #ff0000">*</span>-->
          <van-field readonly v-model="formData1.JDSJ" label="鉴定时间" />
          <!--<van-field-->
          <!--readonly-->
          <!--clickable-->
          <!--name="datetimePicker"-->
          <!--:value="formData.JDSJ"-->
          <!--label="鉴定时间"-->
          <!--placeholder="请选择鉴定时间"-->
          <!--@click="showPickerq = true"-->
          <!--/>-->
          <!--<van-popup v-model="showPickerq" position="bottom">-->
          <!--<van-datetime-picker-->
          <!--v-model="currentDate"-->
          <!--type="date"-->
          <!--title="选择鉴定时间"-->
          <!--@cancel="showPickerq = false"-->
          <!--@confirm="onConfirmRQ"-->
          <!--/>-->
          <!--</van-popup>-->
        </div>
        <!-- <div class="inputWrap">
          <van-field readonly v-model="formData1.SCR" label="上传人" />
        </div>
        <div
          style="
            color: black;
            border-bottom: 1px solid #d2d2d2;
            padding-bottom: 4px;
            font-size: 16px;
          "
        >
          <span>备注</span>
          <van-field
            readonly
            v-model="formData1.BZ"
            type="textarea"
            label
            :border="true"
            disable-default-padding
            style="background-color: #e4e4e4; margin-top: 4px"
          />
        </div> -->
      </van-form>
      <p class="subTitle"><span class="line"></span>附件</p>
      <div class="fujian">
        <ul>
          <li v-for="(item, index) in tableData" :key="index" @click="priviewFile(item)">
            {{ index + 1 + "." + item.name }}
          </li>
        </ul>
      </div>
    </div>
    <div class="content" v-if="this.row.JDDJ == '245' || this.row.JDDJ == '246'">
      <div v-if="
        (this.row.JDDJ == '245' || this.row.JDDJ == '246') &&
        this.isshow6 &&
        this.row.JWFS == '259'
      " class="info">
        {{ html1 }}
      </div>
      <div v-if="
        (this.row.JDDJ == '245' || this.row.JDDJ == '246') &&
        this.isshow6 &&
        this.row.JWFS == '264'
      " class="info">
        {{ html2 }}
      </div>
      <van-form validate-first :class="{ smallFontSize: showEdition, mediumFontSize: !showEdition }">
        <p class="subTitle"><span class="line"></span>鉴定信息</p>
        <div class="inputWrap">
          <!--<span style="color: #ff0000">*</span>-->
          <van-field readonly v-model="formData1.JDJG" label="鉴定机构" />
          <!--<van-field-->
          <!--readonly-->
          <!--clickable-->
          <!--name="picker"-->
          <!--:value="formData.JDJG"-->
          <!--label="鉴定机构"-->
          <!--placeholder="选择鉴定机构"-->
          <!--@click="showPickerT = true"-->
          <!--/>-->
          <!--<van-popup v-model="showPickerT" position="bottom">-->
          <!--<van-picker-->
          <!--show-toolbar-->
          <!--:columns="TownColumns"-->
          <!--value-key="DICNAME"-->
          <!--@confirm="onConfirmTown"-->
          <!--@cancel="showPickerT = false"-->
          <!--/>-->
          <!--</van-popup>-->
        </div>
        <div class="inputWrap">
          <!--<span style="color: #ff0000">*</span>-->
          <van-field readonly v-model="formData1.JDBGBH" label="鉴定报告编号" />
        </div>
        <div class="inputWrap">
          <!--<span style="color: #ff0000">*</span>-->
          <!--<van-field readonly v-model="formData.JDDJ | inUseName1(ENUM.JDDJARR)" label="鉴定等级" />-->
          <van-field readonly clickable name="picker" :value="formData1.JDDJ | inUseName1(ENUM.JDDJARR)" label="鉴定等级"
            placeholder="请选择鉴定等级" @click="ENUM.JDDJ = true" />
          <!--<van-popup v-model="ENUM.JDDJ" position="bottom">-->
          <!--<van-picker-->
          <!--show-toolbar-->
          <!--:columns="ENUM.JDDJARR"-->
          <!--value-key="DICNAME"-->
          <!--@confirm="onConfirmTown1"-->
          <!--@cancel="ENUM.JDDJ = false"-->
          <!--/>-->
          <!--</van-popup>-->
        </div>
        <div class="inputWrap">
          <!--<span style="color: #ff0000">*</span>-->
          <van-field readonly v-model="formData1.JDSJ" label="鉴定时间" />
          <!--<van-field-->
          <!--readonly-->
          <!--clickable-->
          <!--name="datetimePicker"-->
          <!--:value="formData.JDSJ"-->
          <!--label="鉴定时间"-->
          <!--placeholder="请选择鉴定时间"-->
          <!--@click="showPickerq = true"-->
          <!--/>-->
          <!--<van-popup v-model="showPickerq" position="bottom">-->
          <!--<van-datetime-picker-->
          <!--v-model="currentDate"-->
          <!--type="date"-->
          <!--title="选择鉴定时间"-->
          <!--@cancel="showPickerq = false"-->
          <!--@confirm="onConfirmRQ"-->
          <!--/>-->
          <!--</van-popup>-->
        </div>
        <!-- <div class="inputWrap">
          <van-field readonly v-model="formData1.SCR" label="上传人" />
        </div> -->
        <!-- <div
          style="
            color: black;
            border-bottom: 1px solid #d2d2d2;
            padding-bottom: 4px;
            font-size: 16px;
          "
        >
          <span>备注</span>
          <van-field
            readonly
            v-model="formData1.BZ"
            type="textarea"
            label
            :border="true"
            disable-default-padding
            style="background-color: #e4e4e4; margin-top: 4px"
          />
        </div> -->
      </van-form>
      <p class="subTitle"><span class="line"></span>附件</p>
      <div class="fujian">
        <ul>
          <li v-for="(item, index) in tableData" :key="index" style="line-height: 26px" @click="priviewFile(item)">
            {{ index + 1 + "." + item.name }}
          </li>
        </ul>
      </div>
      <el-button type="primary" size="small" @click="handlegotopdf1">预览鉴定报告</el-button>
      <el-button type="primary" size="small" @click="handlegotopdf">预览解危通知书</el-button>
      <!-- <p class="title">
        <span style="color: #ff0000">*</span>
        房屋改造中照片
      </p>
      <van-uploader
        @click-upload="getList"
        @click-preview="lookFile"
        :after-read="afterRead"
        :before-delete="delectFile"
        v-model="fileLists"
        multiple
      /> -->
      <p class="subTitle"><span class="line"></span>危改信息</p>
      <div v-if="this.row.JDDJ == '245' || this.row.JDDJ == '246'">
        <div>
          <!-- <div class="inputWrap" v-if="isShow4">
            <span style="color: #ff0000">*</span>
            <van-field
              clickable
              readonly
              :value="formData.IF_TKFK | inUseName(ENUM.ISARR)"
              label="是否腾空"
              placeholder="请选择是否"
              @click="ENUM.IS = true"
            />
            <van-popup v-model="ENUM.IS" position="bottom" v-if="ISEDIT">
              <van-picker
                show-toolbar
                :columns="ENUM.ISARR"
                value-key="DICNAME"
                @confirm="handleClick"
                @cancel="ENUM.IS = false"
              />
            </van-popup>
          </div>
          <div class="inputWrap" v-if="isShow4 && isShow5">
            <span style="color: #ff0000">*</span>
            <van-field
              readonly
              clickable
              name="datetimePicker"
              :value="formData.TKFKSJ"
              label="腾空时间"
              placeholder="请选择腾空时间"
              @click="showPickerq = true"
            />
            <van-popup v-model="showPickerq" position="bottom" v-if="ISEDIT">
              <van-datetime-picker
                v-model="currentDate"
                type="date"
                title="选择腾空时间"
                @cancel="showPickerq = false"
                @confirm="onConfirmRQ3"
              />
            </van-popup>
          </div> -->
          <div class="inputWrap" v-if="isShow6">
            <span style="color: #ff0000">*</span>
            <van-field readonly clickable name="datetimePicker" :value="formData.CCSJ" label="拆除时间"
              placeholder="请选择拆除时间" @click="showPickerq = true" />
            <van-popup v-model="showPickerq" position="bottom" v-if="ISEDIT">
              <van-datetime-picker v-model="currentDate" type="date" title="选择拆除时间" @cancel="showPickerq = false"
                @confirm="onConfirmRQ4" />
            </van-popup>
          </div>
        </div>
        <div class="inputWrap">
          <span style="color: #ff0000">*</span>
          <van-field readonly clickable name="picker" :value="formData.JWFS | inUseName1(TownColumns3)" label="解危方式"
            placeholder="选择解危方式" @click="showPickerT3 = true" />
          <van-popup v-model="showPickerT3" position="bottom" get-container="#popup" v-if="ISEDIT">
            <van-picker show-toolbar :columns="TownColumns3" value-key="DICNAME" @confirm="onConfirmTown3"
              @cancel="showPickerT3 = false" />
          </van-popup>
        </div>
        <div v-if="formData.JWFS == '265'">
          <div class="inputWrap">
            <span style="color: #ff0000">*</span>
            <van-field clickable name="picker" :value="GZR" label="工匠" :readonly="!ISEDIT" placeholder="选择工匠"
              @click="onConfirmTown4" />
            <!--<van-popup v-model="showPickerT4" position="bottom">-->
            <!--<van-picker show-toolbar :columns="TownColumns4" value-key="artisanName" @confirm="onConfirmTown4" @cancel="showPickerT4 = false" />-->
            <!--</van-popup>-->
          </div>
          <div class="inputWrap">
            <span style="color: #ff0000">*</span>
            <van-field v-model="formData.GJSJH" :readonly="!ISEDIT" label="手机号码" />
          </div>
          <!-- <div class="inputWrap">
            <span style="color: #ff0000">*</span>
            <van-field
              readonly
              clickable
              name="datetimePicker"
              :value="formData.KGSJ"
              label="开工时间"
              placeholder="请选择开工时间"
              @click="showPickerq10 = true"
            />
            <van-popup v-model="showPickerq10" position="bottom" v-if="ISEDIT">
              <van-datetime-picker
                v-model="currentDate"
                type="date"
                title="选择年月日"
                @cancel="showPickerq10 = false"
                @confirm="onConfirmRQ"
              />
            </van-popup>
          </div>
          <div class="inputWrap">
            <span style="color: #ff0000">*</span>
            <van-field
              readonly
              clickable
              name="datetimePicker"
              :value="formData.JGSJ"
              label="竣工时间"
              placeholder="请选择竣工时间"
              @click="showPickerq1 = true"
            />
            <van-popup v-model="showPickerq1" position="bottom" v-if="ISEDIT">
              <van-datetime-picker
                v-model="currentDate"
                type="date"
                title="选择年月日"
                @cancel="showPickerq1 = false"
                @confirm="onConfirmRQ1"
              />
            </van-popup>
          </div>
          <div class="inputWrap">
            <span style="color: #ff0000">*</span>
            <van-field
              clickable
              readonly
              :value="formData.IFYS | inUseName(ENUM.ISARR1)"
              label="是否验收"
              placeholder="请选择是否"
              @click="ENUM.IS1 = true"
            />
            <van-popup v-model="ENUM.IS1" position="bottom" v-if="ISEDIT">
              <van-picker
                show-toolbar
                :columns="ENUM.ISARR1"
                value-key="DICNAME"
                @confirm="confirmIS1"
                @cancel="ENUM.IS1 = false"
              />
            </van-popup>
          </div> -->
        </div>
      </div>
    </div>
    <van-popup v-model="shoulm">
      <div class="con_box">
        <h3>{{ text.title }}</h3>
        <p>{{ text.message }}</p>
        <div class="btnv">
          <span @click="handleClose()" v-if="text.btn.cancelText">
            {{ text.btn.cancelText }}
          </span>
          <span @click="handleOk(SaveData)" v-if="text.btn.okText">
            {{ text.btn.okText }}
          </span>
        </div>
      </div>
    </van-popup>
    <div class="footer" v-if="!isshow6">
      <div class="bottomBtn" @click="getinsertDataView">下一步</div>
    </div>
  </div>
</template>

<script>
import {
  QuerySignCallback,
  dataServerOpenDataView,
  GetFileData,
  FileServerProxy,
  FileServerUpload,
  DelectFile,
  Artisans,
  dataTransFilePreview
} from "@/utils/api";
import openfile from "gdt-jsapi";
export default {
  name: "FarmersRenovation",
  data() {
    return {
      formData1: {},
      GZR: "",
      shoulm: false,
      isShow4: true,
      isShow5: true,
      isshow6: false,
      isShow6: true,
      showEdition: false,
      showPickerq: false,
      showPickerT3: false,
      showPicker4: false,
      showPickerT4: false,
      showPickerq1: false,
      showPickerq10: false,
      JFLYcolumns: [],
      showPickerT: false,
      ISshowNowKNLX: true,
      // ENUM.JDDJARR: [],
      TownColumns: [],
      TownColumns3: [],
      TownColumns4: [],
      showPickerT: false,
      ISEDIT: false,
      TownColumns: [],
      JFLYcolumns1: [],
      JFLYcolumns2: [],
      JFLYcolumns4: [],
      isadd: "",
      groupGuids: "",
      text: {
        title: "温馨提示",
        message: "请在我要建房模块发起建房申请！",
        btn: {
          okText: "确定",
          cancelText: "取消",
        },
      },
      fileLists: [],
      tableData: [
        {
          name: "鉴定报告",
          groupGuid: "88d711ba-870c-40f2-a81d-71df8caeefd4",
          url: "",
        },
        {
          name: "解危通知书",
          groupGuid: "fb4bb94f-df61-4690-81f4-b751c42c92fb",
          url: "",
        },
      ],
      QYDWMC: "",
      ISShow3: false,
      row: {},
      //当前鉴定等级
      JDDJ: "",
      tableDataList: "",
      html: "经鉴定，您的房子为AB级",
      html1: "镇街已同意对本危房采取腾空防控，请及时搬离!",
      html2: "镇街已同意对本危房采取拆除，请及时搬离!",
      currentDate: new Date(),
      ENUM: {
        ISARR: [],
        IS: false,
        ISARR1: [],
        IS1: false,
        JDLXARR: [],
        JDLX: false,
        JDDJARR: [],
        JDDJ: false,
      },
      formData: {
        JDSJ: "",
        JGSJ: "",
        IFYS: "",
        JDJG: "",
        JDDJ: "",
        JWFS: "",
        TKFKSJ: "",
        GJXM: "",
        JDBGBH: "",
        SCR: "",
        BZ: "",
        GJSJH: "",
        IF_TKFK: "",
        CCSJ: "",
      },
    };
  },
  watch: {},
  filters: {
    inUseName: function (msg, data) {
      let name = "";
      data.forEach((item) => {
        if (item.DICID == msg) {
          name = item.DICNAME;
        }
      });
      return name;
    },
    inUseName1: function (msg, data) {
      let name = "";
      if (data) {
        data.forEach((item) => {
          if (item.DICID == msg) {
            name = item.DICNAME;
          }
        });
      }

      return name;
    },
  },
  methods: {
    CheckIsAndroid() {
      var browser = {
        versions: (function () {
          var u = navigator.userAgent,
            app = navigator.appVersion;
          return {
            //移动终端浏览器版本信息
            ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
            android: u.indexOf("Android") > -1 || u.indexOf("Linux") > -1, //android终端或uc浏览器 //u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
            iPhone: u.indexOf("iPhone") > -1, //是否为iPhone或者QQHD浏览器
            iPad: u.indexOf("iPad") > -1, //是否iPad
          };
        })(),
      };
      if (browser.versions.android) return true;
      return false;
    },
    handlegotopdf1() {
      //安卓逻辑
      // "https://nfzjszlb.jst.zj.gov.cn/PrintServer/api/PreviewWordRpt?groupGuid=%7B4CD6F0FC-AC91-430B-B838-70DBABE0F603%7D&toRowGuid=" +
      // this.row.ROW_GUID +
      // "&dataGuid=2ffd285d-f8b9-4b94-841d-ac9d7e0321e6",
      let baseurl = this.row.URL.replace(/#/g,":")
      let url = baseurl + 'PrintServer/api/PreviewWordRpt?groupGuid=%7B4CD6F0FC-AC91-430B-B838-70DBABE0F603%7D' + '&toRowGuid=' + this.row.ROW_GUID + '&dataGuid=005d990a-3c77-46b3-9e6a-6ec5ed33b24c'
      // http://47.111.64.28:9501/PrintServer/api/PreviewWordRpt?groupGuid=%7B4CD6F0FC-AC91-430B-B838-70DBABE0F603%7D&toRowGuid=09eb06e5-1203-6a0b-1d43-a91db46925d7&dataGuid=005d990a-3c77-46b3-9e6a-6ec5ed33b24c   //鉴定报告接口
     console.log(url)
      if (this.CheckIsAndroid()) {
        this.$router.push({
          path: "./viewPDF",
          query: {
            data:url

          },
        });
      } else {
        ZWJSBridge.openLink({
          url:
          url,
        })
          .then((res) => {
          })
          .catch((err) => {
            window.open(
              url
            );
          });
      }
    },
    handlegotopdf() {
      let baseurl = this.row.URL.replace(/#/g,":")
      if (this.CheckIsAndroid()) {
        // alert(1)
        console.log("https://nfzjszlb.jst.zj.gov.cn/PrintServer/api/PreviewWordRpt?groupGuid=%7B36016AAC-063A-4EEB-AC08-55930B788DD6%7D&toRowGuid=" +
          this.row.ROW_GUID +
          "&dataGuid=a47e6933-a98c-414e-8a85-bbe484544860")
        this.$router.push({
          path: "./viewPDF",
          query: {
            data:
            baseurl + "PrintServer/api/PreviewWordRpt?groupGuid=%7B36016AAC-063A-4EEB-AC08-55930B788DD6%7D&toRowGuid=" +
              this.row.ROW_GUID +
              "&dataGuid=a47e6933-a98c-414e-8a85-bbe484544860",
          },
        });
      } else {
        // alert(2)
        // console.log("https://nfzjszlb.jst.zj.gov.cn/PrintServer/api/PreviewWordRpt?groupGuid=%7B36016AAC-063A-4EEB-AC08-55930B788DD6%7D&toRowGuid=" +
        //   this.row.ROW_GUID +
        //   "&dataGuid=a47e6933-a98c-414e-8a85-bbe484544860")
        ZWJSBridge.openLink({
          url:
            baseurl + "PrintServer/api/PreviewWordRpt?groupGuid=%7B36016AAC-063A-4EEB-AC08-55930B788DD6%7D&toRowGuid=" +
            this.row.ROW_GUID +
            "&dataGuid=a47e6933-a98c-414e-8a85-bbe484544860",
        })
          .then((res) => {
          })
          .catch((err) => {
            window.open(
              baseurl + "PrintServer/api/PreviewWordRpt?groupGuid=%7B36016AAC-063A-4EEB-AC08-55930B788DD6%7D&toRowGuid=" +
              this.row.ROW_GUID +
              "&dataGuid=a47e6933-a98c-414e-8a85-bbe484544860"
            );
          });
      }
    },
    getinsertDataView: async function (file) {

      //先保存再跳转
      //鉴定等级为cd 和 ab有区别跳转
      //新增
      if (true) {
        this.formData["TO_ROW_GUID"] = this.row.ROW_GUID;
        // this.formData['PKID'] = this.row.PKID

        this.formData.GJXM = this.GZR;
        if (this.row.NODE_GUID == "{6048BDEF-057A-4080-A536-D9EEE89626D7}") {
          for (let i in this.formData) {
            if (this.formData1[i]) {
              this.formData[i] = this.formData1[i];
            }
          }
        } else {
          delete this.formData.TO_ROW_GUID;
          delete this.formData.NODE_GUID;
        }
        for (let i in this.formData) {
          if (this.formData1[i]) {
            if (i !== "JWFS") {
              this.formData[i] = this.formData1[i];
            }
          }
        }
        let acccode = "";
        if (this.isadd) {
          acccode = "0fb3f6123d1b4fe6851c99532c463f6f";
          delete this.formData.PKID;
        } else {
          this.formData.PKID = this.tableDataList.PKID;
          this.formData.ROW_GUID = this.tableDataList.ROW_GUID;
          acccode = "77ad6c1591e54d4fbc45ecc90374a2a2";
        }
        let params = {
          dataGuid: "9a9e3b1c-bb15-4f68-9ffc-8449d104c1c7",
          strParams: JSON.stringify([this.formData]),
          token: window.localStorage.getItem("token"),
        };

        let params1 = {
          accessCode: acccode,

          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: params,
        };
        const res = await QuerySignCallback(params1);
        if (eval("(" + res.data.data + ")").Success == true) {
          this.formData1.JWFS = this.formData.JWFS;
          this.formData1.JDJGID = this.row.JDJGID;
          this.$toast.success("成功！");
          this.$router.push({
            path: "/TreeSelectAutoSend",
            query: { data: this.row, listData: this.formData1, list: true },
          });
        } else {
          this.$toast.fail(res.data.msg);
        }
      } else {
        this.$toast.success("请输入必填项！");
      }
    },
    //获取相关材料
    getList() {
      this.groupGuids = "d46b2463-896b-4fff-9ad1-48ae7cbc7c9c";
    },
    handleClose() {
      this.shoulm = false;
    },
    handleOk(data) {
      // this.handleButton();
      this.$router.push({
        path: "/ApplicationPage?name=原址翻建",
      });
    },
    //获取相关材料
    priviewFile: async function (item) {
      //解围通知书 250d4b56-f4ca-4ff8-ae0e-3872688087e6
      //鉴定报告  9788c08d-3d96-4f0d-85da-d233094abcf6
      //获取鉴定信息和解围通知书 暂写
      if (item.name == "解危通知书") {
        ZWJSBridge.openLink({
          url:
            "https://nfzjszlb.jst.zj.gov.cn/PrintServer/api/PreviewWordRpt?groupGuid=%7B36016AAC-063A-4EEB-AC08-55930B788DD6%7D&toRowGuid=" +
            this.row.ROW_GUID +
            "&dataGuid=a47e6933-a98c-414e-8a85-bbe484544860",
        })
          .then((res) => {
          })
          .catch((err) => {
            window.open(
              "https://nfzjszlb.jst.zj.gov.cn/PrintServer/api/PreviewWordRpt?groupGuid=%7B36016AAC-063A-4EEB-AC08-55930B788DD6%7D&toRowGuid=" +
              this.row.ROW_GUID +
              "&dataGuid=a47e6933-a98c-414e-8a85-bbe484544860"
            );
          });
      } else {
        //查询数据
        let dataGuid = "2ffd285d-f8b9-4b94-841d-ac9d7e0321e6";
        let searchObject = JSON.stringify([
          {
            field: "TO_ROW_GUID",
            value: JSON.parse(this.$route.query.data).ROW_GUID,
            operator: "=",
          },
        ]);
        let token = window.localStorage.getItem("token");
        let params = {
          accessCode: "688bd3883572440a859dfd8ba9194e7b",

          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: {
            dataguid: dataGuid,
            searchObject: searchObject,
            token: token,
          },
        };
        const resss = await QuerySignCallback(params);
        let redata = JSON.parse(resss.data.data);
        if (redata.Data && redata.Data.length > 0) {
          ZWJSBridge.openLink({
            url:
              "https://nfzjszlb.jst.zj.gov.cn/PrintServer/api/PreviewWordRpt?groupGuid=%7B4CD6F0FC-AC91-430B-B838-70DBABE0F603%7D&toRowGuid=" +
              this.row.ROW_GUID +
              "&dataGuid=2ffd285d-f8b9-4b94-841d-ac9d7e0321e6",
          })
            .then((res) => {
            })
            .catch((err) => {
              // window.open(`https://nfzjszlb.jst.zj.gov.cn/PrintServer/api/PreviewWordRpt?groupGuid=%7B4CD6F0FC-AC91-430B-B838-70DBABE0F603%7D&toRowGuid=${this.row.ROW_GUID}&dataGuid=2ffd285d-f8b9-4b94-841d-ac9d7e0321e6`,)
            });
        }
      }
    },
    //获取相关材料
    //获取相关材料
    getFile: async function () {
      // this.fileLists = [];
      // const res1 = await GetFileData({
      //   groupGuid: "d46b2463-896b-4fff-9ad1-48ae7cbc7c9c",
      //   toRowGuid: this.row.ROW_GUID,
      // });
      // if (res1.data.FilesInfo.length > 0) {
      //   // this.fileLists.push(...res1.data.FilesInfo)
      //   res1.data.FilesInfo.forEach((element) => {
      //     //   this.file.forEach((item) => {
      //     if (element.GROUPGUID == "d46b2463-896b-4fff-9ad1-48ae7cbc7c9c") {
      //       element["isImage"] = true;
      //       this.getFileUrl(element, "");
      //     }
      //     // });
      //   });
      let params = {
        "accessCode": "1fdcbce42c6d4748a020feba618d54b8",
        "cityCode": window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "",
        "params": {
          "groupGuid": "d46b2463-896b-4fff-9ad1-48ae7cbc7c9",
          "toRowGuid": this.row.ROW_GUID,
          token: window.localStorage.getItem('token')
        }
      }
      const res = await FileServerProxy(params)
      let data = JSON.parse(res.data.data)
      if (data.FilesInfo.length > 0) {
        data.FilesInfo.forEach((element) => {
          if (element.GROUPGUID == "d46b2463-896b-4fff-9ad1-48ae7cbc7c9c") {
            element["isImage"] = true;
            this.getFileUrl(element, "");
          }
        })
      }
    },
    //获取附件文件流
    getFileUrl: async function (element, item) {
      let formData = new FormData();
      formData.append("accessCode", "98bcf528966e48ce896a8b3fd02d45d5");
      formData.append(
        "cityCode",
        window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "441300000000"
      );
      formData.append(
        "paramStr",
        JSON.stringify({
          fileGuid: element.ROW_GUID,
        })
      );
      let response = await dataTransFilePreview(formData);
      if (response) {
        var img = new Blob([new Int8Array(response.data, 0)], {
          type: response.headers["content-type"],
        }); //type类型可自定义
        element["isImage"] = true;
        element["url"] = window.URL.createObjectURL(img);
        if (item) {
          item.fileList.push(element);
        } else {
          this.fileList.push(element);
        }
      }
    },
    lookFile(item) {
      let url =
        window.g.BaseURL +
        "FileServer/api/Preview?token=" +
        window.localStorage.getItem("token") +
        "&" +
        "fileGuid=" +
        encodeURIComponent(item.ROW_GUID);
      // if (ZWJSBridge) {
      ZWJSBridge.openLink({
        url: url,
      })
        .then((res) => {
        })
        .catch((err) => {
          window.open(url);
        });
      // }
    },
    //相关材料
    afterRead(file) {
      // 此时可以自行将文件上传至服务器
      this.getFileServerUpload(file.file);
    },
    getFileServerUpload: async function (file) {
      let formData = new FormData();
      // if (file instanceof Array) {
      //   file.forEach(item => {
      //     formData.append('file', item.file)
      //   })
      // } else {
      //   formData.append('file', file.file)
      // }
      let _this = this;
      formData.append("file", file);
      formData.append("toRowGuid", this.row.ROW_GUID);
      formData.append("groupGuid", this.groupGuids);
      formData.append("token", window.localStorage.getItem("token"));
      const res = await FileServerUpload(formData);
      if (res.data.Success == true) {
        this.$toast.success("上传成功!");
        // this.$notify({ type: 'success', message: '上传成功!' });        // this.$notify({ type: 'success', message: '上传成功!' });
      }
    },
    delectFile: async function (file) {
      let fileguid = "";
      if (file.ROW_GUID) {
        fileguid = file.ROW_GUID;
      } else {
        fileguid = this.fileGuid;
      }
      if (fileguid) {
        let params = {
          accessCode: "ce9b691634de4ebca68dc5bb638d07f4",
          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: {
            fileGuid: fileguid,
            token: window.localStorage.getItem("token"),
          },
        };
        const res = await FileServerProxy(params);
        let data = JSON.parse(res.data.data).Success;
        if (data) {
          this.$toast.success("删除成功!");
        }
      }
    },
    // delectFile: async function (file) {
    //   if (file.ROW_GUID) {
    //     const res = await DelectFile({
    //       fileGuid: file.ROW_GUID,
    //       token: window.localStorage.getItem("token"),
    //     });
    //     if (res.data.Success) {
    //       this.$toast.success("成功!");
    //     } else {
    //       this.$toast.fail(res.data.Msg);
    //     }
    //   }
    // },
    onConfirmTown1(value) {
      this.formData.JDDJ = value.DICID;
      this.ENUM.JDDJ = false;
    },
    onConfirmTown(value) {
      this.formData.JDJG = value.DICID;
      this.showPickerT = false;
    },
    onConfirmTown3(value) {
      this.formData.JWFS = value.DICID;
      this.row.JWFS = value.DICID;
      this.formData1.JWFS = value.DICID; //wjh 2022-04-05 发送是通过listdata(formData1)里面的jwfs来判断的，最好统一
      this.showPickerT3 = false;
      console.log(value.DICID)
      if (value.DICID == "265") {
        this.isShow4 = true;
        this.isShow5 = true;
      } else {
        this.isShow4 = true;
      }
      if (value.DICID == "264") {
        this.isShow5 = false;
        this.isShow6 = true;
      } else {
        this.isShow6 = false;
        this.isShow5 = true;
      }
      if (value.DICID == "266") {
        this.isShow4 = false;
        this.isShow5 = true;
        //选择重建要提示申请危房
        this.shoulm = true;
      }
    },
    onConfirmTown4(value) {
      // this.GZR = value.artisanName
      // this.formData.GJXM = value.DICID;
      // this.showPicker4 = false;
      this.row.JWFS = this.formData.JWFS;
      this.row.IF_TKFK = this.formData.IF_TKFK;
      this.row.TKFKSJ = this.formData.TKFKSJ;
      if (this.ISEDIT) {
        this.$router.push({
          path: "/craftsmanServices",
          query: {
            id: "ChooseCraftsman",
           data: JSON.stringify(this.row),
            type: "工匠",
          },
        });
      }
    },
    onConfirmRQ(val) {
      let year = val.getFullYear();
      let month = val.getMonth() + 1;
      let day = val.getDate();
      let hour = val.getHours();
      let minute = val.getMinutes();
      if (month >= 1 && month <= 9) {
        month = `0${month}`;
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`;
      }
      if (hour >= 0 && hour <= 9) {
        hour = `0${hour}`;
      }
      if (minute >= 0 && minute <= 9) {
        minute = `0${minute}`;
      }
      this.className = "timeClass";
      this.formData.KGSJ = `${year}-${month}-${day}`;
      this.showPickerq10 = false;
    },

    // 1.鉴定等级为d级，必须要求腾空防控，并且填写
    // 腾空防控时间
    // 2.鉴定等级为C,并且是困难家庭，解危方式为修
    // 缮。鉴定等级为D,并且是困难家庭，解危方式为
    // 修缮、拆除、拆除車建。鉴定等级为C、D，不是
    // 困难家庭，解危方式包括修缮、拆除、拆除重
    // 建、腾空防控。

    //鉴定等级字典值
    getJFLYOpenDataView: async function () {
      let dataGuid = "c7007467-d12c-4b87-948e-aa58b2df2131";
      let searchObject = [];
      let token = window.localStorage.getItem("token");
      let params = {
        accessCode: "688bd3883572440a859dfd8ba9194e7b",

        cityCode: window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "441300000000",
        params: {
          dataguid: dataGuid,
          searchObject: searchObject,
          token: token,
        },
      };
      const res = await QuerySignCallback(params);
      this.JFLYcolumns = eval("(" + res.data.data + ")").Data;
      // 2.鉴定等级为C,并且是困难家庭，解危方式为修
      // 缮。鉴定等级为D,并且是困难家庭，解危方式为
      // 修缮、拆除、拆除車建。鉴定等级为C、D，不是
      // 困难家庭，解危方式包括修缮、拆除、拆除重
      // 建、腾空防控。
      this.ENUM.JDDJARR = this.JFLYcolumns;
    },
    //鉴定机构字典值
    getJFLYOpenDataView1: async function () {
      let dataGuid = "b3be00d8-bd87-4601-8ef0-9b7b0c8929cf";
      let searchObject = [];
      let token = window.localStorage.getItem("token");
      let params = {
        accessCode: "688bd3883572440a859dfd8ba9194e7b",

        cityCode: window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "441300000000",
        params: {
          dataguid: dataGuid,
          searchObject: searchObject,
          token: token,
        },
      };
      const res = await QuerySignCallback(params);
      this.JFLYcolumns1 = eval("(" + res.data.data + ")").Data;
      if (this.JFLYcolumns1.length === 0) {
      } else {
        this.JFLYcolumns1.forEach((item) => {
          this.TownColumns.push(item.QYZZMC);
        });
      }
    },
    //危机解除方式字典值
    getJFLYOpenDataView2: async function () {
      this.TownColumns3 = [];
      let dataGuid = "92f63613-9186-4a84-ba66-d098614e07a6";
      let searchObject = [];
      let token = window.localStorage.getItem("token");
      let params = {
        accessCode: "688bd3883572440a859dfd8ba9194e7b",

        cityCode: window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "441300000000",
        params: {
          dataguid: dataGuid,
          searchObject: searchObject,
          token: token,
        },
      };
      const res = await QuerySignCallback(params);
      this.JFLYcolumns2 = eval("(" + res.data.data + ")").Data;
      this.TownColumns3 = this.JFLYcolumns2;
      let newArr = [];
      if (this.JFLYcolumns2.length === 0) {
      } else {
        if (this.row.KNLX == "5" && this.row.JDDJ == "245") {
          this.TownColumns3.forEach((it) => {
            if (it.DICNAME == "修缮加固") {
              newArr.push(it);
            }
          });
          this.TownColumns3 = newArr;
        } else if (this.row.KNLX == "5" && this.row.JDDJ == "246") {
          this.TownColumns3.forEach((item) => {
            if (item.DICNAME != "腾空防控") {
              newArr.push(item);
            }
          });
          this.TownColumns3 = newArr;
        }
      }
    },
    //改造负责人(选择工匠 修缮加固)
    getJFLYOpenDataView3: async function () {
      // let dataGuid = "090c599b-1ee1-4864-bbb4-f29579fac928";
      // let searchObject = [];
      // let token = window.localStorage.getItem("token");
      // let params = {
      //   accessCode: "688bd3883572440a859dfd8ba9194e7b",
      //
      //   cityCode: window.localStorage.getItem("citycode")
      //     ? window.localStorage.getItem("citycode")
      //     : "",
      //   params: {
      //     dataguid: dataGuid,
      //     searchObject: searchObject,
      //     token: token,
      //   },
      // };
      // const res = await QuerySignCallback(params);
      let params = {
        accessCode: "7295a77b2730446c90684d4e0e33c255",
        appKey: "6738c6db-69e8-11ec-a673-6805cab640a0",
        artisanName: "",
        bookNumber: "",
        cityCode: this.row.SCITY ? this.row.SCITY.substring(0, 6) : "",
        pageNo: 1,
        pageSize: 10000,
      };
      const res = await Artisans(params);
      this.TownColumns4 = res.data.data.pageList;

      // this.JFLYcolumns4 = eval("(" + res.data.data + ")").Data;
      // if (this.JFLYcolumns4.length === 0) {
      // } else {
      //   this.JFLYcolumns4.forEach((item) => {
      //     this.TownColumns4.push(item.DICNAME);
      //   });
      // }
    },
    onConfirmRQ1(val) {
      let year = val.getFullYear();
      let month = val.getMonth() + 1;
      let day = val.getDate();
      let hour = val.getHours();
      let minute = val.getMinutes();
      if (month >= 1 && month <= 9) {
        month = `0${month}`;
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`;
      }
      if (hour >= 0 && hour <= 9) {
        hour = `0${hour}`;
      }
      if (minute >= 0 && minute <= 9) {
        minute = `0${minute}`;
      }
      this.className = "timeClass";
      this.formData.JGSJ = `${year}-${month}-${day}`;
      this.showPickerq1 = false;
    },
    onConfirmRQ3(val) {
      let year = val.getFullYear();
      let month = val.getMonth() + 1;
      let day = val.getDate();
      let hour = val.getHours();
      let minute = val.getMinutes();
      if (month >= 1 && month <= 9) {
        month = `0${month}`;
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`;
      }
      if (hour >= 0 && hour <= 9) {
        hour = `0${hour}`;
      }
      if (minute >= 0 && minute <= 9) {
        minute = `0${minute}`;
      }
      this.className = "timeClass";
      this.formData.TKFKSJ = `${year}-${month}-${day}`;
      this.showPickerq = false;
    },
    onConfirmRQ4(val) {
      let year = val.getFullYear();
      let month = val.getMonth() + 1;
      let day = val.getDate();
      let hour = val.getHours();
      let minute = val.getMinutes();
      if (month >= 1 && month <= 9) {
        month = `0${month}`;
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`;
      }
      if (hour >= 0 && hour <= 9) {
        hour = `0${hour}`;
      }
      if (minute >= 0 && minute <= 9) {
        minute = `0${minute}`;
      }
      this.className = "timeClass";
      this.formData.CCSJ = `${year}-${month}-${day}`;
      this.showPickerq = false;
    },
    confirmIS(val) {
      this.formData.IFYS = val.DICID;
      this.ENUM.IS = false;
    },
    confirmIS1(val) {
      this.formData.IFYS = val.DICID;
      this.ENUM.IS1 = false;
    },
    handleClick(val) {
      this.formData.IF_TKFK = val.DICID;
      this.ENUM.IS = false;
      if (val.DICID == "6") {
        this.isShow6 = false;
        this.isShow5 = false;
      } else {
        this.isShow6 = true;
        this.isShow5 = true;
      }
    },
    getData: async function () {
      let params = {
        dataguid: "9a9e3b1c-bb15-4f68-9ffc-8449d104c1c7",
        searchObject: JSON.stringify([
          {
            field: "ROW_GUID",
            value: this.row.ROW_GUID,
            link: "OR",
            operator: "=",
          },
        ]),
        token: window.localStorage.getItem("token"),
      };
      let params1 = {
        accessCode: "688bd3883572440a859dfd8ba9194e7b",
        cityCode: window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "441300000000",
        params: params,
      };
      const res = await QuerySignCallback(params1);
      let data = eval("(" + res.data.data + ")").Data;
      ;
      if (data.length > 0) {
        //修改
        this.isadd = false;
        this.tableDataList = data[0];
      } else {
        //新增
        this.isadd = true;
      }

      //获取当前危改等级
      // if (data[0].JWFS == '265') {
      //   this.ISShow3 = true
      // }
      // if (data.length > 0) {
      //   this.formData.JDSJ = this.formData.JDSJ ? this.formData.JDSJ.split(' ')[0] : ''
      //   this.formData.JGSJ = this.formData.JGSJ ? this.formData.JGSJ.split(' ')[0] : ''
      // }
    },
  },
  mounted: async function () {
    let Base64 = require('js-base64').Base64
    // console.log(Base64.decode("MTc3MDY1MDA3NTM="))
    this.getJFLYOpenDataView();
    //得到附件材料
    // this.getFile();
    this.getJFLYOpenDataView1();

    this.row = JSON.parse(this.$route.query.data);
    if(this.row.ROW_GUID){
      this.row =JSON.parse(this.$route.query.data);
    }else{
      this.row=JSON.parse(this.row)
    }
    console.log(this.row)
    this.formData.JWFS = JSON.parse(this.$route.query.data).JWFS;
    this.getData();
    try {
      console.log(this.$route.query.id)
      this.GZR = this.$route.query.id.artisanName;
      if (this.$route.query.id.phone) {
        this.formData.GJSJH = Base64.decode(this.$route.query.id.phone)
      }
      this.formData.GJXM = this.$route.query.id.artisanName;
      this.formData.IF_TKFK = this.row.IF_TKFK;
      this.formData.TKFKSJ = this.row.TKFKSJ;
      // if (this.formData.IF_TKFK == "6") {
      //   this.isShow6 = false;
      //   this.isShow5 = false;
      // } else {
      //   this.isShow6 = true;
      //   this.isShow5 = true;
      // }
    } catch (e) { }
    // alert(this.$route.query.type)
    if (this.$route.query.type === "NHWFGZ") {
      //调用存储过程
      let paramsData = {
        procName: "up_housesecurity",
        dtParams: JSON.stringify([
          { I_USERID: "'" + this.row.ROW_GUID + "'", I_TYPE: 3 },
        ]),
        token: window.localStorage.getItem("token"),
      };
      let paer = {
        accessCode: "69db6bece3a7480592e2ec753d1e335e",
        cityCode: window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "441300000000",
        params: paramsData,
      };
      const res = await FileServerProxy(paer);
      let JBXXrowData = eval("(" + res.data.data + ")").Data[0];
      this.row.JWFS = JBXXrowData.JWFS;
      this.row.JDDJ = JBXXrowData.JDDJ;
      this.formData.JWFS = this.row.JWFS;
      this.formData1 = JBXXrowData;
      this.ISEDIT = true;
      // this.formData.JWFS = this.row.JWFS
    } else {
      this.formData.JWFS = JSON.parse(this.$route.query.data).JWFS;
    }
    console.log(this.formData.JWFS)
    if (this.formData.JWFS == "265") {
      this.ISShow3 = true;
      this.isShow6 = false
    }
    // if (this.formData.JWFS == "265") {
    //   this.isShow4 = true;
    // } else {
    //   this.isShow4 = true;
    // }
    if (this.formData.JWFS == "264") {
      this.isShow5 = false;
    } else {
      this.isShow5 = true;
    }
    this.getJFLYOpenDataView3();
    if (!this.$route.query.id) {
      if (this.row.NODE_GUID == "{0C256BFE-BC5F-4D63-8AEC-4630EC19F78B}") {
        // alert(1)
        // let params = {
        //获取房屋鉴定信息以及判断
        let paramsData = {};
        paramsData.procName = "up_processusername";
        paramsData.dtParams = JSON.stringify([
          { I_USERID: "'" + this.row.ROW_GUID + "'", TYPE: 5 },
        ]);
        paramsData.token = window.localStorage.getItem("token");
        let paer = {
          accessCode: "69db6bece3a7480592e2ec753d1e335e",
          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: paramsData,
        };
        const req = await FileServerProxy(paer);
        let reqData = JSON.parse(req.data.data);
        if (reqData.Data && reqData.Data.length > 0) {
          this.row.JWFS = reqData.Data[0].JWFS;
          this.formData1 = reqData.Data[0];
          if (reqData.Data[0].GJXM) {
            this.GZR = reqData.Data[0].GJXM;
          }
          this.formData1.JWFS = reqData.Data[0].JWFS;
          this.formData = reqData.Data[0];
          if (reqData.Data[0].OPTYPE == 2 && reqData.Data[0].OPTYPE2 == 3) {
            this.ISEDIT = false;
          } else {
            this.ISEDIT = true;
          }
        }
        if (reqData.Data[0].OPTYPE == 2) {
          this.ISEDIT = true;
          //判断第一次的鉴定等级
          let paramsData1 = {};
          paramsData1.procName = "up_processusername";
          paramsData1.dtParams = JSON.stringify([
            { I_USERID: "'" + this.row.ROW_GUID + "'", TYPE: 11 },
          ]);
          paramsData1.token = window.localStorage.getItem("token");
          let paer1 = {
            accessCode: "69db6bece3a7480592e2ec753d1e335e",
            cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
            params: paramsData1,
          };

          const req1 = await FileServerProxy(paer1);
          let reqData1 = JSON.parse(req1.data.data);
          try {
            this.row.JDDJ = reqData1.Data[0].JDDJ;
            // this.formData1 = reqData1.Data[0];
          } catch (err) {
          }
        } else {
          this.row.JDDJ = reqData.Data[0].JDDJ;
        }
        if (reqData.Data[0].OPTYPE2 == 3) {
          this.isshow6 = true;
          let paramsData2 = {};
          paramsData2.procName = "up_processusername";
          paramsData2.dtParams = JSON.stringify([
            { I_USERID: this.row.ROW_GUID, TYPE: 15 },
          ]);
          paramsData2.token = window.localStorage.getItem("token");
          let paer = {
            accessCode: "69db6bece3a7480592e2ec753d1e335e",
            cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
            params: paramsData2,
          };

          const req = await FileServerProxy(paer);
        }
        this.getJFLYOpenDataView2();
        if (this.formData.JWFS == "266") {
          this.isShow4 = false;
          this.isShow5 = true;
        }
      }
    } else {
      if (this.row.NODE_GUID == "{0C256BFE-BC5F-4D63-8AEC-4630EC19F78B}") {
        // alert(2)
        let paramsData = {};
        paramsData.procName = "up_processusername";
        paramsData.dtParams = JSON.stringify([
          { I_USERID: "'" + this.row.ROW_GUID + "'", TYPE: 20 },
        ]);
        paramsData.token = window.localStorage.getItem("token");
        let paer = {
          accessCode: "69db6bece3a7480592e2ec753d1e335e",
          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: paramsData,
        };
        const req = await FileServerProxy(paer);
        let reqData = JSON.parse(req.data.data);
        if (reqData.Data && reqData.Data.length > 0) {
          this.formData1 = reqData.Data[0];
          if (reqData.Data[0].GJXM) {
            this.GZR = reqData.Data[0].GJXM;
          }
          this.formData1.JWFS = reqData.Data[0].JWFS;
          this.ISEDIT = true;
        }
        this.getJFLYOpenDataView2();
        if (this.formData.JWFS == "266") {
          this.isShow4 = false;
          this.isShow5 = true;
        }
      }
    }
    if (this.row.KNLX == "5") {
      this.ISshowNowKNLX = true;
    } else {
      this.ISshowNowKNLX = false;
    }
    this.getFile();
    if (this.showEdition) {
      $("#FarmersRenovation .van-field__control").css(
        "fontSize",
        "16px !important"
      );
      $("#FarmersRenovation .van-cell").css("fontSize", "16px !important");
    } else {
      $("#FarmersRenovation .van-field__control").css(
        "fontSize",
        "20px !important"
      );
      $("#FarmersRenovation .van-cell").css("fontSize", "20px !important");
    }
    // this.formData1.JDSJ=/\d{4}-\d{1,2}-\d{1,2}/g.exec(this.formData1.JDSJ)
    if (String(this.formData1.JDSJ).length > 10) {
      this.formData1.JDSJ = String(this.formData1.JDSJ).substring(
        0,
        String(this.formData1.JDSJ).length - 8
      );
    }
    if (String(this.formData.TKFKSJ).length > 10) {
      this.formData.TKFKSJ = String(this.formData.TKFKSJ).substring(
        0,
        String(this.formData.TKFKSJ).length - 8
      );
    }
    if (String(this.formData.CCSJ).length > 10) {
      this.formData.CCSJ = String(this.formData.CCSJ).substring(
        0,
        String(this.formData.CCSJ).length - 8
      );
    }
    if (String(this.formData.KGSJ).length > 10) {
      this.formData.KGSJ = String(this.formData.KGSJ).substring(
        0,
        String(this.formData.KGSJ).length - 8
      );
    }
    if (String(this.formData.JGSJ).length > 10) {
      this.formData.JGSJ = String(this.formData.JGSJ).substring(
        0,
        String(this.formData.JGSJ).length - 8
      );
    }
    // this.formData.TKFKSJ = /\d{4}-\d{1,2}-\d{1,2}/g.exec(this.formData.TKFKSJ)
    // this.formData.CCSJ = /\d{4}-\d{1,2}-\d{1,2}/g.exec(this.formData.CCSJ)
    if (ZWJSBridge) {
      ZWJSBridge.setTitle({
        title: "农户危改整治",
      })
        .then((res) => {
        })
        .catch((err) => {
        });
    }
  },
};
</script>
<style scoped lang="scss">
#FarmersRenovation {
  height: 100vh;

  .top {
    height: 90px;
    background: #ffffff;
    padding-top: 25px;
    text-align: center;

    .origin {
      width: 22px;
      height: 22px;
      background: #007aff;
      border-radius: 50%;
      display: inline-block;
    }

    .line {
      width: 20vw;
      /*height: 1px;*/
      border: 1px dashed #007aff;
      display: inline-block;
    }
  }

  .fujian {
    color: #007aff;
  }

  .content {
    width: 100%;
    height: calc(100% - 144px);
    overflow: auto;
    background: #ffffff;
    padding: 10px;

    .subTitle {
      color: #3f8ffc;
      height: 40px;
      line-height: 40px;
      font-size: 16px;
      //   .line {
      //     width: 6px;
      //     height: 26px;
      //     background: #3f8ffc;
      //     display: inline-block;
      //     margin-right: 10px;
      //   }
    }

    .title {
      color: black;
      font-size: 16px;
      line-height: 40px;
    }

    .inputWrap {
      display: flex;
      justify-content: center;
      align-items: center;
      border-bottom: 1px solid #d2d2d2;
    }

    .van-cell {
      padding: 10px 0;
    }
  }

  .footer {
    padding: 0 10px;
    text-align: center;

    p {
      color: #000;
      font-size: 14px;
      line-height: 40px;
    }

    .bottomBtn {
      height: 50px;
      background: #007aff;
      line-height: 50px;
      text-align: center;
      color: #ffffff;
      font-weight: bold;
    }
  }
}
</style>
<style lang="scss">
#FarmersRenovation {
  .van-field__label {
    width: auto !important;
  }

  .info {
    width: 90%;
    margin: 0 auto;
    background: #e4e4e4;
    border-radius: 20px;
    padding: 10px 20px;
    font-weight: bold;
    color: #232323;
    line-height: 30px;
    text-align: center;
    margin-top: 10px;
  }

  .mediumFontSize {
    .van-field__label {
      /*font-size: 20px;*/
    }
  }

  .el-input__inner {
    /*font-size: 16px;*/
    text-align: right;
    border: none;
  }

  .van-cell:not(:last-child)::after {
    left: 0;
    // border-bottom: 1px solid rgb(210, 210, 210);
  }

  .van-cell::after {
    border-bottom: none;
  }

  .van-cell {
    padding: 10px 0;
    font-size: 16px;
  }

  .van-field__control {
    text-align: right;
  }

  textarea {
    text-align: left !important;
  }

  .van-field__label {
    color: black !important;
    letter-spacing: 1px;
  }

  .van-cell {
    color: black;
  }

  .van-popup {
    border-radius: 10px;

    .con_box {
      width: 270px;
      line-height: 1;
      text-align: center;
      color: #4d5c82;
      padding: 15px;
      box-sizing: border-box;

      >h3 {
        font-size: 20px;
        margin-top: 10px;
        margin-bottom: 20px;
      }

      >p {
        font-size: 17px;
        margin-bottom: 30px;
      }

      .btnv {
        display: flex;
        justify-content: space-between;

        >span {
          display: block;
          width: 114px;
          background-color: #e0e5f5;
          text-align: center;
          line-height: 44px;
          font-size: 17px;
        }

        >span:last-of-type {
          background-color: #1288fe;
          color: #ffffff;
        }
      }
    }
  }
}
</style>
